//package com.gxa.p2p.filter;
//
//import com.gxa.p2p.common.JsonResult;
//import com.gxa.p2p.common.enum1.ExceptionCode;
//import com.gxa.p2p.common.exception.MyException;
//import lombok.SneakyThrows;
//import org.springframework.web.filter.OncePerRequestFilter;
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//
///**
// * 权限验证
// * @author HS
// */
//@WebFilter(urlPatterns = "/*")
//
//public class PowerFilter extends OncePerRequestFilter {
//
//
//    @SneakyThrows
//    @Override
//    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
//
////        String url = request.getRequestURI();
////
////        if(url.indexOf("/admin")>=0){
////
////            filterChain.doFilter(request, response);
////        }
////
////        String token = request.getHeader("token");
////
////        HttpSession session = request.getSession();
////
////        String sessionToken = session.getAttribute("token").toString();
////
////        if(token==null){
////
////            throw new MyException(ExceptionCode.WRONG_TOKEN);
////        }
////        if(sessionToken==null){
////
////            throw new MyException(ExceptionCode.WRONG_TOKEN);
////
////        }
////
////        if(!token.equals(sessionToken)){
////
////            throw new MyException(ExceptionCode.WRONG_TOKEN);
////        }
//
//        filterChain.doFilter(request, response);
//
//    }
//}
